package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.service.FourCO2Service;
import edu.ynu.se.xiecheng.achitectureclass.service.SensorDataResponse;
import edu.ynu.se.xiecheng.achitectureclass.service.SensorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/fourCO2")
public class FourCO2Controller {
    private FourCO2Service fourCO2Service;

    @Autowired
    public FourCO2Controller(FourCO2Service fourCO2Service) {
        this.fourCO2Service = fourCO2Service;
    }

    @PostMapping("/allCO2Datas")
    public List<SensorDataResponse> getSensorData() {
        return fourCO2Service.getAllCO2Data();
    }
}
